<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://chances.com.cn/jsp/epgdata" prefix="epgdata"%>
<%@taglib uri="http://chances.com.cn/jsp/epgui" prefix="epgui"%>
<%@taglib uri="http://chances.com.cn/jsp/schedule" prefix="schedule" %>


<c:set var="categoryCode">${param.categoryCode}</c:set>
<c:set var="businessCode">${param.businessCode}</c:set>
<c:set var="contextPath">${param.contextPath}</c:set>
<c:set var="resourcePath">${param.resourcePath}</c:set>
<c:set var="siteCode">${param.siteCode}</c:set>



<%-- 频道查询 --%>
<epgdata:categoryItem var="chanels" code="${categoryCode}" size="99"/>

<%-- 内容查询 --%>
<c:forEach items="${chanels}" var="item" varStatus="i">
 	<%--查询频道的当前节目单与下一条节目单 --%>
 	<c:set var="scheduleNav" value=""/>
 	<schedule:scheduleNav var="scheduleNav" channelCode="${item.itemCode}"/>
	<c:set var="imgSrc" value="${contextPath}/sites/weixin/images/defaultBg_3.jpg"/>
	<epgdata:content var="channel" type="channel" code="${item.itemCode}" />
	<c:if test="${!empty channel.icon}">
		<c:set var="imgSrc" value="${resourcePath}${channel.icon}"/>
	</c:if>
	<c:if test="${!empty item.itemIcon}">
		<c:set var="imgSrc" value="${resourcePath}${item.itemIcon}"/>
	</c:if>
	<div class="row row-empty" id="live_${i.index}" onclick="gotoLink('${item.url}','live_${i.index}')">
		<div class="col-xs-4 col-content" style="width:27%;background-color: #f2f1f1;">
			<div style="padding-right:10%;padding-left:10%;">
			<img style="width: 100%;" class="lazyImg" src="${contextPath}/sites/weixin/images/defaultBg_3.jpg" data-original="${imgSrc}"/></div>
		</div>
		<div class="col-xs-8">
			<div><span style="font-size: 1.2em;">${item.title}</span></div>
			<div><img src="${contextPath}/sites/weixin/images/thr.png"/>
				<span style="font-size: 1.1em;">
					<c:if test="${not empty scheduleNav }">
						<fmt:formatDate value="${scheduleNav.schedule.startTime}" pattern="HH:mm"/>&nbsp;${scheduleNav.schedule.name}
				 	</c:if>
				</span>
			</div>
			<div>
				<span style="color:#aaaaaa;font-size: 0.9em;">
					<c:if test="${not empty scheduleNav }">
						<fmt:formatDate value="${scheduleNav.nextSchedule.startTime}" pattern="HH:mm"/>&nbsp;${scheduleNav.nextSchedule.name}
				 	</c:if>
				</span> 
		 	</div>
		</div>
	</div>
	<div class="row" style="height:3px;background-color:#f2f1f1;margin-top:6px;margin-bottom:4px;"></div>
</c:forEach>

<script>
$(".lazyImg").lazyload();
</script>
